<template>
    <div class="app-container depot-warning-page">
        <el-tabs v-model="params.type" @tab-click="tabChange">
            <template v-for="v in tabs">
                <el-tab-pane :label="v.title" :name="v.name" :key="v.title" />
            </template>
        </el-tabs>

        <div class="table-arer">
            <Table
                :api="$Api.index.getGoodsWarning"
                :params="params"
                :index="true"
                :sort="false"
                :pagination="false"
                dataName="data.woodGoodsCounts"
                totalName="data.sumNumber"
                height="80vh"
                ref="Table"
            >
                <el-table-column label="包号" prop="baleNum" />
                <el-table-column label="品名" prop="goodsName" />
                <el-table-column label="品牌" prop="brandName" />
                <el-table-column label="等级" prop="level" width="80"  />
                <el-table-column label="厚度" prop="ply" width="80"  />
                <el-table-column label="宽度" prop="width" width="80"  />
                <el-table-column label="长度" prop="length" width="80" />
                <el-table-column label="片数" prop="sliceCount" />
                <el-table-column label="件数" prop="pieceCount" />
                <el-table-column label="方数" prop="inCount" />
                <el-table-column label="货物状态" prop="goodsState" />
                <el-table-column label="入库日期" prop="inTime" />
                <el-table-column label="库龄(天)" prop="day"  width="80" />
                <el-table-column label="备注" prop="remark" width="200" />
            </Table>
        </div>
    </div>
</template>

<script>
export default {
    data: () => {
        return {
            tabs: [
                {
                    title: "六个月库龄",
                    num: 0,
                    data: [],
                    name: "6",
                    page: 1,
                    finish: false,
                },
                {
                    title: "五个月库龄",
                    num: 0,
                    data: [],
                    name: "5",
                    page: 1,
                    finish: false,
                },
                {
                    title: "四个月库龄",
                    num: 0,
                    data: [],
                    name: "4",
                    page: 1,
                    finish: false,
                },
                {
                    title: "三个月库龄",
                    num: 0,
                    data: [],
                    name: "3",
                    page: 1,
                    finish: false,
                },
            ],
            params: {
                type: "6",
                pageNum: 1,
                pageSize: 100,
            },
        };
    },
    created() {
        // this.getWarningList();
    },
    methods: {
        tabChange(e) {
            // console.log(e, this.activeName);
            this.$refs.Table.getData();
        },
        // getWarningList() {
        //     let { activeName, tabs } = this;
        //     let i = tabs.findIndex((v) => {
        //         return v.name == activeName;
        //     });
        //     // let {page}
        //     this.$Api.index
        //         .getGoodsWarning(`${activeName}?pageNum=${1}&pageSize=100`)
        //         .then(() => {
        //         });
        // },
    },
};
</script>

<style lang="scss" scoped>
.depot-warning-page {
}
</style>